package com.jims.api.v1.controller.common;

import com.baomidou.kisso.my.controller.BaseController;
import com.jims.master.common.data.Message;
import com.jims.master.common.utils.SecurityUtil;
import com.jims.master.modules.base.user.entity.SysDepartment;
import com.jims.master.modules.base.user.service.SysDepartmentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * Created by Administrator on 2017/11/16 0016.
 */
@RestController
@RequestMapping(value = "/parts")
public class PartsController extends BaseController {
    @Autowired
    private SysDepartmentService sysDepartmentService;
    /**
      * @Title: parts
      * @Description: 查询科室信息
      * @param parentId
      * @return
      * @author CT
      * @date 2017/11/22 0017
      * @throws
     */
    @RequestMapping(value = "/parts",method ={RequestMethod.GET,RequestMethod.POST})
    public String partsV100(String parentId){
	/*	Map<String, Object> map = new HashMap<String, Object>();*/
		/*map.put("registList",registList);*/
        List<SysDepartment> partsList = sysDepartmentService.getByParentId(parentId);
        Message mes = new Message();
        mes.setData(partsList);
        return SecurityUtil.encryptMsgData(mes);
    }
}
